<?php

namespace App\Jobs;

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Log;

class Ceshi implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $user;
    /**
     * Create a new job instance.
     *
     * @return void
     */
//    public function __construct($delay)
//    {
////        $this->user = $user;
//        $this->delay($delay);
//        $this->onQueue('shi');
//    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
//        $user = new User();
//        $res = $user->where('id',100)->first();
//        if($res){
//            Log::info('ok');
//        }else{
//            throw new \Exception('没有对应数据,之后重复执行');
//        }
        $path = 'http://www.tdcall.net/2019-03-03/2019-03-03-16-18-11_928618826581103_172.31.194.139_d001s002.zip';
        $name = 'qwertyuiop.mp3';
        $res = voiceUploadA($path,$name);
        Log::info($res);

//
//        $dir = "/www/wwwroot/call/public/uploads/voice/" . date("Ym/d", time()).'/';
//
//        if (!file_exists($dir)){
//            Log::info('目录不存在');
//            mkdir ($dir,0777,true);
//        }
    }
}
